﻿@if (User.Identity.IsAuthenticated)
{
    <nav>
        <ul>
            <li>
                <div class="modal-wrap">
                    <a href="#"><i class="icon icon-plus"></i>Добавить сайт</a>
                    <div class="modal modal-add modal-top">
                        <div id="add-site-form" class="modal-form" data-bind="css: { error: asVM.isError, success: asVM.isOk }, validationOptions: { insertMessages: false }">
                            @Html.AntiForgeryToken()
                            <input type="url" class="input" autocomplete="off" placeholder="адрес сайта" data-bind="value: asVM.Url, event: { focus: asVM.StartEdit, blur: asVM.SearchTtile }" />
                            <i class="icon icon-tag"></i>
                            <input type="text" autocomplete="off" class="input input-tag" placeholder="теги" data-bind="value: asVM.Tags, event: { focus: asVM.StartEdit }" />
                            <input type="text" autocomplete="off" class="input" placeholder="название" data-bind="value: asVM.Title" />

                            <div class="status">
                                <div class="checkbox">
                                    <i class="icon icon-checkbox"></i>Не добавлять в общие теги
                                        <input type="checkbox" data-binding="checked: IsPrivate">
                                </div>

                                <div class="submit button" data-bind="click: asVM.submit">добавить</div>
                                <div class="success">
                                    <i class="icon icon-ok"></i><span>Сайт добавлен успешно!</span>
                                </div>
                                <div class="error">
                                    <i class="icon icon-error"></i><span data-bind="text: asVM.errorMessage"></span>
                                    <span data-bind="validationMessage: asVM.Url"></span>
                                    <span data-bind="validationMessage: asVM.Tags"></span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </li>
            <li><a href="#" onclick="alert('Coming soon');" title="Coming soon">Мои закладки</a></li>
            <li class="username">@Html.ActionLink(User.Identity.Name, "Manage", "Account")</li>
            <li class="slash"></li>
            <li>@using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm" }))
                {
                @Html.AntiForgeryToken()
                <a href="javascript:document.getElementById('logoutForm').submit()">Выйти</a>
                }</li>
        </ul>
    </nav>
}
else
{
    <nav>
        <ul>
            <li>
                <div class="modal-wrap">
                    <a href="#"><i class="icon icon-plus"></i>Добавить сайт</a>
                    <div class="modal modal-add modal-top">
                        <div id="add-site-form" class="modal-form" data-bind="css: { error: asVM.isError, success: asVM.isOk }, validationOptions: { insertMessages: false }">
                            @Html.AntiForgeryToken()
                            <input type="url" class="input" placeholder="адрес сайта" data-bind="value: asVM.Url, event: { focus: asVM.StartEdit }">
                            <i class="icon icon-tag"></i>
                            <input type="text" class="input input-tag" placeholder="теги" data-bind="value: asVM.Tags">
                            <div class="status">
                                <div class="submit button" data-bind="click: asVM.submit">добавить</div>
                                <div class="success">
                                    <i class="icon icon-ok"></i>Сайт добавлен успешно!
                                </div>
                                <div class="error">
                                    <i class="icon icon-error"></i><span data-bind="text: asVM.errorMessage"></span>
                                    <span data-bind="validationMessage: asVM.Url"></span>
                                    <span data-bind="validationMessage: asVM.Tags"></span>
                                </div>

                            </div>
                        </div>
                    </div>
                </div>
            </li>
            <li>
                <div class="modal-wrap">
                    <a href="#">Зарегистрироваться</a>
                    <div class="modal modal-signup modal-top">
                        @Html.Partial("RegistrationForm")
                    </div>
                </div>
            </li>
            <li class="slash"></li>
            <li>
                <div class="modal-wrap">
                    <a href="#">Войти</a>
                    <div class="modal modal-signin modal-top">
                        @Html.Partial("LoginForm")
                    </div>
                </div>
            </li>
        </ul>
    </nav>
}
